package com.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AccpTeacher entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_TEACHER", schema = "ACCP")
public class AccpTeacher implements java.io.Serializable {

	// Fields

	private Integer tid;
	private AccpUser accpUser;
	private AccpBiz accpBiz;
	private String tnickname;
	private Integer tstatus;
	private Timestamp createtime;
	private Set<AccpClass> accpClasses = new HashSet<AccpClass>(0);
	private Set<AccpVote> accpVotes = new HashSet<AccpVote>(0);
	private Set<AccpTask> accpTasks = new HashSet<AccpTask>(0);

	// Constructors

	/** default constructor */
	public AccpTeacher() {
	}

	/** minimal constructor */
	public AccpTeacher(Integer tid) {
		this.tid = tid;
	}

	/** full constructor */
	public AccpTeacher(Integer tid, AccpUser accpUser, AccpBiz accpBiz,
			String tnickname, Integer tstatus, Timestamp createtime,
			Set<AccpClass> accpClasses, Set<AccpVote> accpVotes,
			Set<AccpTask> accpTasks) {
		this.tid = tid;
		this.accpUser = accpUser;
		this.accpBiz = accpBiz;
		this.tnickname = tnickname;
		this.tstatus = tstatus;
		this.createtime = createtime;
		this.accpClasses = accpClasses;
		this.accpVotes = accpVotes;
		this.accpTasks = accpTasks;
	}

	// Property accessors
	@Id
	@Column(name = "TID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getTid() {
		return this.tid;
	}

	public void setTid(Integer tid) {
		this.tid = tid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public AccpUser getAccpUser() {
		return this.accpUser;
	}

	public void setAccpUser(AccpUser accpUser) {
		this.accpUser = accpUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BID")
	public AccpBiz getAccpBiz() {
		return this.accpBiz;
	}

	public void setAccpBiz(AccpBiz accpBiz) {
		this.accpBiz = accpBiz;
	}

	@Column(name = "TNICKNAME")
	public String getTnickname() {
		return this.tnickname;
	}

	public void setTnickname(String tnickname) {
		this.tnickname = tnickname;
	}

	@Column(name = "TSTATUS", precision = 8, scale = 0)
	public Integer getTstatus() {
		return this.tstatus;
	}

	public void setTstatus(Integer tstatus) {
		this.tstatus = tstatus;
	}

	@Column(name = "CREATETIME", length = 7)
	public Timestamp getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpTeacher")
	public Set<AccpClass> getAccpClasses() {
		return this.accpClasses;
	}

	public void setAccpClasses(Set<AccpClass> accpClasses) {
		this.accpClasses = accpClasses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpTeacher")
	public Set<AccpVote> getAccpVotes() {
		return this.accpVotes;
	}

	public void setAccpVotes(Set<AccpVote> accpVotes) {
		this.accpVotes = accpVotes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpTeacher")
	public Set<AccpTask> getAccpTasks() {
		return this.accpTasks;
	}

	public void setAccpTasks(Set<AccpTask> accpTasks) {
		this.accpTasks = accpTasks;
	}

}